package com.lovo.addressbook;

import junit.framework.Assert;
import junit.framework.TestCase;

public class UserTest extends TestCase {
	private User user;
	protected void setUp() throws Exception {
		super.setUp();
		user = new User();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
		user = null;
	}

	public void testGetNo() {
		String userNumber = "7654321";
		user.setNo(userNumber);
		Assert.assertEquals(userNumber, user.getNo());
	}

	public void testSetNo() {
		String userNumber = "abcdefg";
		user.setNo(userNumber);
		Assert.assertEquals(userNumber, user.getNo());
	}
	
	public void testGetName() {
		String name = "foo";
		user.setName(name);
		Assert.assertEquals(name, user.getName());
	}

	public void testSetName() {
		String name = "bonjour";
		user.setName(name);
		Assert.assertEquals(name, user.getName());
	}

	public void testGetAge() {
		Integer age = 12;
		user.setAge(age);
		Assert.assertEquals(age, user.getAge());
	}

	public void testSetAge() {
		Integer age = 21;
		user.setAge(age);
		Assert.assertEquals(age, user.getAge());
	}

	public void testGetSex() {
		String sex = "homme";
		user.setSex(sex);
		Assert.assertEquals(sex, user.getSex());
	}

	public void testSetSex() {
		String sex = "femme";
		user.setSex(sex);
		Assert.assertEquals(sex, user.getSex());
	}

	public void testGetPhone() {
		String phone = "110";
		user.setPhone(phone);
		Assert.assertEquals(phone, user.getPhone());
	}

	public void testSetPhone() {
		String phone = "114";
		user.setPhone(phone);
		Assert.assertEquals(phone, user.getPhone());
	}

	public void testGetImagePath() {
		String imagePath = "c:/ip/edudiant.jpg";
		user.setImagePath(imagePath);
		Assert.assertEquals(imagePath, user.getImagePath());
	}

	public void testSetImagePath() {
		String imagePath = "c:/ip/professer.jpg";
		user.setImagePath(imagePath);
		Assert.assertEquals(imagePath, user.getImagePath());
	}

}
